import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_tutorial/app/modules/mine/getresponsiveview/getresponsiveview_controller.dart';

class GetResponsiveViewPage extends GetResponsiveView<GetResponsiveViewController> {

  GetResponsiveViewPage() 
  : super(
    alwaysUseBuilder: false,
    settings: ResponsiveScreenSettings(
      desktopChangePoint: 1000,
      tabletChangePoint: 768,
      watchChangePoint: 300
    ),
  );

  @override
  Widget? desktop() {
    return Scaffold(
      appBar: AppBar(title: Text('桌面')),

      body: SafeArea(
        child: Text(Get.width.toString())
      )
    );
  }

  @override
  Widget? tablet() {
    return Scaffold(
      appBar: AppBar(title: Text('平板')),

      body: SafeArea(
        child: Text(Get.width.toString())
      )
    );
  }

  @override
  Widget? phone() {
    return Scaffold(
      appBar: AppBar(title: Text('手机')),

      body: SafeArea(
        child: Text(Get.width.toString())
      )
    );
  }

  @override
  Widget? watch() {
    return Scaffold(
      appBar: AppBar(title: Text('手表')),

      body: SafeArea(
        child: Text(Get.width.toString())
      )
    );
  }
}